/*
 *  ------------------------------------------------------------------
 *  Copyright © 2017 Hangzhou DtDream Technology Co.,Lt d. All rights reserved.
 *  ------------------------------------------------------------------
 *              Product: EMR
 *    Module Name: DataTrain
 *      Date Created: 2017-10-23
 *         Description:
 *  ------------------------------------------------------------------
 *  Modification History
 *  DATE            Name           Description
 *  ------------------------------------------------------------------
 *  2017-10-23     XZ 209
 *  ------------------------------------------------------------------
 */

package org.xukai.remoting.sdk.rpc.reader;

import com.dtdream.emr.transmission.data.Record;
import com.dtdream.emr.transmission.exception.TransmissionException;

import java.util.List;

public interface Reader extends AutoCloseable {

    int getId();

    Record read() throws TransmissionException;

    void buffer(List<Record> record) throws InterruptedException;

    void finish();

    void close() throws TransmissionException;

    boolean isClosed();

    void setError(TransmissionException cause);
}
